<?php
class FileAuth extends Action {
	/* (non-PHPdoc)
	 * @see Action::execute()
	 */
	public function execute($params) {
		PluginManager::enabled ( 'cn.usephp.filemgr');
		$me = check_login ( ADMIN_LOGIN_PAGE );
		if (rqst ( 'fs_username' )) { //填写了用户名时
			filesystem_need_auth ();
		}
		$data ['error'] = sess_del ( 'fs_error' );
		$data ['account'] = sess_get ( 'fs_username' );
		$type = CoreOptionModel::getOptionInGroup ( 'type', 'filemgr', 'Ftp' );
		$data ['type'] = $type == 'SSH2' ? 'SSH2' : 'FTP';
		return new SmartyView ( $data, 'files/auth' );
	}
}